﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using My_Patient.DataModel;

namespace My_Patient.Model
{
    public class PatientModel
    {
        public PatientModel(PATIENT pat)
        {
            id = pat.PAT_ID;
            pNO = pat.PAT_NO;
            pName = pat.PAT_NAME;
            pSex=pat.PAT_SEX.HasValue==false?"未知":(pat.PAT_SEX.Value==true ? "女" : "男");
            pAge = pat.PAT_AGE.HasValue==false?0:pat.PAT_AGE.Value;
            pDoctor = pat.PAT_DOCTOR;
            pNosts = pat.PAT_NOSTS;
        }
        public PatientModel() { }
        public int id { get; set; }
        public string pNO { get; set; }
        public string pName { get; set; }
        public string pSex { get; set; }
        public int pAge { get; set; }
        public string pDoctor { get; set; }
        public string pNosts { get; set; }
    }
}
